home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-15
/
voltst10.zip
/
VOLTEST.DOC
< prev
Wrap
Text File
|
1992-10-12
|
4KB
|
96 lines
VOLTEST 1.0 - Volume Tester
by Dan Goodell
VolTest is a utility to check the volume label on a disk and
optionally compare it to a requested name. VolTest returns an
errorlevel code for batch file use, but can also be used to set
an environment variable with the label of the disk in the drive,
if necessary. VolTest can read the true label, including any
leading, trailing, or embedded spaces, which can confuse other
label-matchers.
Syntax: VOLTEST [?] [d:][matchname]
where: [?] displays help screen,
[d:] is the drive specifier, and
[matchname] is the volume label to try and match.
Parameters are optional. If no drive is specified, the default drive
is tested. Note that '?' and '*' are bonafide characters in labels
and are not considered wildcards. Volume labels may include spaces.
A label may validly begin with leading spaces, so no spaces should be
inserted between [d:] and [matchname] unless meant to be part of the
name to match.
When called from a batch file, VolTest returns an exit code that can
be tested with the "if errorlevel..." command. The errorlevel code
is based on the result of a case-sensitive test:
3 = no volume label found
2 = label found, match not requested
1 = label found, does not match request
0 = label found, matches request
Usage and screen output examples: Explanation:
----------------------------------- --------------------------------
C> voltest Data Disk 1 Default drive label matches
SET LABEL=Data Disk 1 the name requested.
C> voltest A:PROGRAMS? Drive A: label does not match.
SET LABEL=VIP*TEXT '?' and '*' are not wildcards.
:Label does not match "PROGRAMS? "
C> voltest z: Drive Z: does not exist or
SET LABEL= has no label.
C> voltest E: Set #1 E: label (with 2 leading spaces)
SET LABEL= My Data does not match the requested
:Label does not match " Set #1 " name (with 4 leading spaces).
C> voltest > setenv.bat Label from default drive is sent
to a batch file. Calling that
file will store the label in an
environment variable.
C> voltest a:> setenv.bat Label from drive A: is sent to a
batch file. Note that putting a
space after 'a:' would cause
VolTest to try to match a label
of only (one or more) spaces.
C> voltest b:DATA #001 > nul Tests B: for label "DATA #001 "
but not displayed on the screen.
As in all examples, errorlevel
can be tested if VolTest is
called from within a batch file.
---------------------------------------------------------------------
VolTest is supplied as is. The author disclaims all warranties,
expressed or implied, including, without limitation, the warranties
of suitability for any purpose. The author assumes no liability for
damages, direct or consequential, which may result from the use of
this program. Users of this program must accept this disclaimer of
warranty.
This program is hereby released into the public domain. Feel free to
alter, edit, or distribute it (hopefully, with this documentation) as
you wish.
If you have any comments or questions about this program, please
contact me at CompuServe [71520,3116] or the address shown below.
October 12, 1992
by Dan Goodell
1261 Hookston Road
Concord, CA 94518
CompuServe: 71520,3116